/*
*  Impp - Instant Messenger
*
*  Copyright (C) 2008  Oliver Schneider
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
#ifndef ICONS_H_
#define ICONS_H_

#include "../../Main.h"
#include "../../core/Buddy.h"
#include "../../core/interfaces/iUserInterface.h"
#include <map>
#include <vector>
#include <wx/imaglist.h>

namespace Impp
{

wxBitmap composeBitmaps(wxBitmap* src1, wxBitmap* src2,const wxSize& size);

class IconFile{
public:
	wxBitmap icon;
	wxString file;

	IconFile(const wxBitmap & icon, const wxString & file);
	virtual ~IconFile();
};

class ActionIcon : public IconFile{
public:
	wxString moduleName;
	wxString actionName;

	ActionIcon(const wxString & moduleName, const wxString & actionName, const wxBitmap & icon, const wxString & file);
	virtual ~ActionIcon();
};

class Icons : public iIcons
{
private:
	std::vector<IconFile*> loadedIcons;

	std::map<int, int> imagelistMapping;
	wxImageList statusImageList;
	wxImageList xstatusImageList;

	#ifdef __WXMSW__
		static std::vector<wxBitmap> statusBitmaps;
		static std::vector<wxBitmap> xstatusBitmaps;
	#endif


	wxString iconPath;

	wxBitmap statusOffline;
	wxBitmap statusOnline;
	wxBitmap statusUnknown;
	wxBitmap statusAway;
	wxBitmap statusDnd;
	wxBitmap statusInvisible;
	wxBitmap statusNA;
	wxBitmap statusOccupied;
	wxBitmap statusFree4Chat;

	wxBitmap msgNew;
	wxBitmap noAvatar;
	wxBitmap imppIcon;

public:
	Icons();
	virtual ~Icons();

	wxBitmap getStatusIcon(const Status & status);
	wxImageList* getStatusImageList();
	int getStatusImageListId(const Status & status);
	void registerActionIcon(const wxString & moduleName,const wxString & actionName, const wxString & iconFile);
	void registerActionIcon(const wxString & moduleName, const wxString & actionName, const wxBitmap & bmp);
	wxBitmap getActionIcon(const wxString & moduleName,const wxString & actionName);
	wxBitmap getBitmap(const wxString & iconFile);
	wxBitmap getSpecialBitmap(const SpecialBitmap & special);

private:
	wxBitmap getBitmapFromFile(const wxString & relPath);

};



}

#endif /*ICONS_H_*/
